Google Trends With Python using PyTrends

build payload

Build Payload

Build Payload is a function which is used to find the trends of all the words we enter

We can pass more than one keyword so see the comparison for example we are passing the following keyword to see their comparison

as you can see that the deep learning is out of competition, the real competition is between machine learning and data science

Similarly lets check some major companies

As you can see the Apple and Samsung are the best competitors, Hawaii is somehow trying to compete but Vivo is out of it

Now let's give some comparison of Bollywood Actors

wooo, I was thinking that Shah Rukh Khan will be on top, but in jan 2022 Salman Khan was on trending

Historical Hourly Interest

If you are interested in the hourly interest of the keyword, you can use the get_historical_intereset() method to fetch hourly data according to the time you have specified.

What does the above data frame tells us? it tells us the hourly search of these actors for example on 2021-09-01 02:00:00, shah rukh khan was searched 7 times, similarly salman khan was searched 13 times in an hour

Interest by Region

Now I want see the search results country wise

The above data shows the searches by country wise,

Pytrends can also help you find keywords that are closely tied to a primary keyword of your choice and then return a list of related keywords shown on Google Trends. Let us find a list of related queries for “machine learning” and return the top queries.

The above are the related queries and keywords searched about salman khan

Lets give some comparison of Google itself, Youtube, Facebook, Instagram and twitter

Insta and twitter are below the line and Google is on top